/*
 * @Author: 专送Pro
 * @Date: 2019-08-23 13:17:18
 * @LastEditors  : wuzhen
 * @LastEditTime : 2020-01-08 19:35:22
 * @Description: 配置文件
 */
export default {
  data() {
    return {
      searchProps: [
        {
          label: "用户账号",
          type: "text",
          key: "account",
          placeholder: "请输入用户账号"
        },
        {
          label: "用户名称",
          type: "text",
          key: "membername",
          placeholder: "请输入用户名称"
        }
      ],
      searchButtons: [
        {
          text: "添加用户",
          btnType: "add",
          type: "primary"
        }
      ],
      columns: [
        {
          title: "用户ID",
          key: "memberid"
        },
        {
          title: "用户账号",
          key: "account"
        },
        {
          title: "用户名称",
          key: "membername"
        },
        {
          title: "所属角色",
          render: (h, params) => {
            const row = params.row;
            const roles = this.roleData
              .filter(v => row.roleids.includes(v.key))
              .map(v => v.label);
            return h("span", roles.join() || "--");
          }
        },
        {
          title: "创建时间",
          minWidth: 170,
          render: (h, params) => {
            const row = params.row;
            return h("span", this.$fmtMoment(row.createtime));
          }
        },
        {
          title: "操作",
          slot: "action",
          width: 220
        }
      ],
      handleBtn: [
        {
          text: "修改",
          btnType: "edit"
        },
        {
          text: "角色管理",
          btnType: "role"
        },
        {
          text: "重置密码",
          type: "error",
          btnType: "reset"
        }
      ]
    };
  }
};
